using System;
using System.Runtime.Serialization;
using Neovolve.Extensibility.VisualStudio.Properties;

namespace Neovolve.Extensibility.VisualStudio
{
    /// <summary>
    /// The <see cref="MenuCommandException"/>
    /// class is used to identify a failure to create menu commands for the addin.
    /// </summary>
    [Serializable]
    public class MenuCommandException : AddinException
    {
        /// <summary>
        /// Initializes a new instance of the 
        /// <see cref="MenuCommandException"/> class.
        /// </summary>
        public MenuCommandException()
            : base(String.Empty, Resources.MenuCommandFailureMessage)
        {
        }

        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="MenuCommandException"/> class.
        /// </summary>
        /// <param name="reason">The reason.</param>
        public MenuCommandException(String reason)
            : base(reason, Resources.MenuCommandFailureMessage)
        {
        }

        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="MenuCommandException"/> class.
        /// </summary>
        /// <param name="reason">The reason.</param>
        /// <param name="innerException">The inner exception.</param>
        public MenuCommandException(String reason, Exception innerException)
            : base(reason, Resources.MenuCommandFailureMessage, innerException)
        {
        }

        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="MenuCommandException"/> class.
        /// </summary>
        /// <param name="reason">The reason.</param>
        /// <param name="message">The message.</param>
        public MenuCommandException(String reason, String message)
            : base(reason, message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the 
        /// <see cref="UnusedReferenceDetector.MenuCommandException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"></see> that contains contextual information about the source or destination.</param>
        /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"></see> is zero (0). </exception>
        /// <exception cref="T:System.ArgumentNullException">The info parameter is null. </exception>
        protected MenuCommandException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}